
Security News
Deno 2.2 Improves Dependency Management and Expands Node.js Compatibility
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
svelte-parse-markup
Advanced tools
Parse Svelte markup without parsing the script or style tags.
import { parse } from 'svelte-parse-markup'
const ast = parse('some svelte code')
console.log(ast.instance.content.body)
// output:
// [
// {
// type: 'Text',
// start: <num>,
// end: <num>,
// raw: 'instance script content',
// content: 'instance script content'
// }
// ]
console.log(ast.module.content.body)
// output:
// [
// {
// type: 'Text',
// start: <num>,
// end: <num>,
// raw: 'module script content',
// content: 'module script content'
// }
// ]
console.log(ast.css.content.styles)
console.log(ast.css.children)
// output:
// 'css content'
// [
// {
// type: 'Text',
// start: <num>,
// end: <num>,
// raw: 'css content',
// content: 'css content'
// }
// ]
svelte-parse-markup
skips parsing scripts and styles, and injects a Text
node instead. Check out the Svelte REPL AST output tab to compare how the original AST would look like.
MIT
FAQs
Parse Svelte markup without parsing the script or style tags
We found that svelte-parse-markup demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
Security News
React's CRA deprecation announcement sparked community criticism over framework recommendations, leading to quick updates acknowledging build tools like Vite as valid alternatives.
Security News
Ransomware payment rates hit an all-time low in 2024 as law enforcement crackdowns, stronger defenses, and shifting policies make attacks riskier and less profitable.